import { _decorator, Component, log, Node } from 'cc';
import { ModuleMgr } from './ModuleMgr';
const { ccclass, property } = _decorator;

@ccclass('ModuleBase')
export class ModuleBase extends Component {

    //onLoad()
    onInit(...rest: any[]) {

    }
    //start()
    onLateInit(...rest: any[]) {

    }
    //update()
    onUpdate(dt: number, ...rest: any[]) {

    }

    //lateUpdate()
    onLateUpdate(dt: number, ...rest: any[]) {

    }


    //默认发送消息的函数
    handleMsg(info: any) {
        console.log(info);
    }

    //封装消息发送的方法
    sendMsg(msgName: string, moduleName: string, ...rest: any[]) {
        ModuleMgr.instance.sendMsg.apply(ModuleMgr.instance, arguments);
    }
}


